package cn.tedu.aop.demo;

import org.springframework.stereotype.Component;

/**
 * 计算器实现类
 */
@Component
public class CalculatorImpl implements Calculator{
    @Override
    public int add(int x, int y) {
        return x+y;
    }

    @Override
    public double add(double x, double y) {
        return x+y;
    }

    @Override
    public String add(String x, String y) {
        return String.valueOf(Double.parseDouble(x)+Double.parseDouble(y));
    }

    @Override
    public int sub(int x, int y) {
        return x-y;
    }

    @Override
    public int mul(int x, int y) {
        return x*y;
    }

    @Override
    public int div(int x, int y) {
        return x/y;
    }
}
